#coding:utf-8
'''
Created on 2018��3��20��

@author: 97234
'''
import getpass


class FakeLogin(object):
    '''
    classdocs
    '''


    def __init__(self):
       self.name = 'king'
       self.password = 'haha,no pw' 
       self.banner = 'hello, you have login system'
       self.run()
       
    def run(self):
        ''' 仿Linux终端登录窗口 '''
        print("不好意思， 只有一个用户king")
        print("偷偷的告诉你，密码是6个8哦")
        while True:
            print("Login:king")
            pw = getpass.getpass("Password:")
            #pw = raw_input("Password:")
            print(pw)
            if pw == '888888':
                print("%s" %self.banner)
                print("退出程序")
                exit()
            else:
                if len(pw) > 12:
                    print("密码长度应该小于12")
                    continue
                elif len(pw) < 6:
                    print("密码长度大于6才对")
                    continue
                else:
                    print("可惜，密码错误。继续猜")
                    continue


if __name__ == '__main__':
    f1 = FakeLogin()